Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add complex support and test #1439

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add complex support and test #1439

wants to merge 6 commits into from

Conversation

Chao1Han
Copy link
Contributor

@Chao1Han Chao1Han commented Mar 7, 2025

This PR enables XCCL to support complex data types for certain operations (allreduce, reduce, broadcast). Since oneCCL does not support complex data types, the values are converted to real numbers before calling the oneCCL API. The implementation method and supported data types are fully aligned with NCCL.

if (!tensor.is_xpu() || tensor.is_sparse() || tensor.is_complex()) {
C10_THROW_ERROR(
ValueError, "Tensors must be XPU and dense and non-complex");
if (!tensor.is_xpu() || tensor.is_sparse()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you remove this condition, then all collectives will by default support complex. Does it make sense for oneCCL right now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, all tensor entre getXcclDataTypewill check tensor is_complex. If we confirm op support for complex types, we will convert them to real before calling getXcclDataType. Otherwise, an error will be raised within getXcclDataType.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants